package com.tidc.seaserverweb.controller;

import com.tidc.seaservermodel.dto.UserDto;
import com.tidc.seaservermodel.entity.Fres;
import com.tidc.seaserverservice.service.SecondaryUserService;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


@RestController
@RequestMapping("/secondary/user")
//@CrossOrigin(origins = "*",maxAge = 3600,allowCredentials = "true")
public class SecondaryUserController {
    @Resource
    private SecondaryUserService secondaryUserService;

    @GetMapping("/info")
    public Fres<UserDto> getUserInfo(Authentication authentication){
        Fres<UserDto> userInfo = secondaryUserService.getUserInfo(authentication);
        return userInfo;
    }
}
